package deng.ejbtx.ejb.tx;

import java.io.File;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;

import deng.ejbtx.jboss.AppService;
import deng.pojo.SmartProperties;
import deng.pojo.SingleScriptGroovyEngine;

public abstract class AbstractTxBean extends SingleScriptGroovyEngine implements TxBean {
	@EJB
	private AppService appService;
	
	@PostConstruct
	public void init() {
		SmartProperties config = appService.getConfig();
		this.scriptFile = new File(config.getFile("txBeanScriptDir"), getClass().getName() + ".groovy");
		this.initGroovyEngine();
	}
	
	@Override
	public void runDemo() {
		runGroovyScript();
	}
}
